import {cdnRequest} from "@/utils/HttpRequest";


export async function findByRedisList() {
  //SwaggerResources


  return cdnRequest<API.BaseArrayDataResult<API.SysConfig>> (
    "sys/redis/findByList", {
      method: "GET"
    } )


}

export async function redisClear() {
  //SwaggerResources
  let arr: string[] = ["token", "userInfo", "umi_locale", "umi-ui-bubble-hide"]
  let len = localStorage.length;
  for (let i = 0; i < len; i++) {
    let key = localStorage.key ( i );
    console.log ( key, arr.indexOf ( <string>key ), arr );
    if (arr.indexOf ( <string>key ) == -1) {
      if (key != null) {
        localStorage.removeItem ( key );
      }
    }
  }

  return cdnRequest<API.BaseResult> (
    "sys/redis/delAll", {
      method: "POST"
    } )


}




